/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.DeliveryUserLocation;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface DeliveryUserLocationMapper {
    /* @mbggenerated */
    @Delete({
        "delete from delivery_user_location",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /* @mbggenerated */
    @Insert({
        "insert into delivery_user_location (id, user_id, ",
        "latitude, longitude, ",
        "speed, accuracy, altitude, ",
        "verticalAccuracy, horizontalAccuracy, ",
        "create_time)",
        "values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, ",
        "#{latitude,jdbcType=DOUBLE}, #{longitude,jdbcType=DOUBLE}, ",
        "#{speed,jdbcType=DOUBLE}, #{accuracy,jdbcType=DOUBLE}, #{altitude,jdbcType=DOUBLE}, ",
        "#{verticalaccuracy,jdbcType=DOUBLE}, #{horizontalaccuracy,jdbcType=DOUBLE}, ",
        "#{createTime,jdbcType=TIMESTAMP})"
    })
    int insert(DeliveryUserLocation record);

    /* @mbggenerated */
    @InsertProvider(type=DeliveryUserLocationSqlProvider.class, method="insertSelective")
    int insertSelective(DeliveryUserLocation record);

    /* @mbggenerated */
    @Select({
        "select",
        "id, user_id, latitude, longitude, speed, accuracy, altitude, verticalAccuracy, ",
        "horizontalAccuracy, create_time",
        "from delivery_user_location",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
        @Result(column="latitude", property="latitude", jdbcType=JdbcType.DOUBLE),
        @Result(column="longitude", property="longitude", jdbcType=JdbcType.DOUBLE),
        @Result(column="speed", property="speed", jdbcType=JdbcType.DOUBLE),
        @Result(column="accuracy", property="accuracy", jdbcType=JdbcType.DOUBLE),
        @Result(column="altitude", property="altitude", jdbcType=JdbcType.DOUBLE),
        @Result(column="verticalAccuracy", property="verticalaccuracy", jdbcType=JdbcType.DOUBLE),
        @Result(column="horizontalAccuracy", property="horizontalaccuracy", jdbcType=JdbcType.DOUBLE),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP)
    })
    DeliveryUserLocation selectByPrimaryKey(Integer id);

    /* @mbggenerated */
    @UpdateProvider(type=DeliveryUserLocationSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(DeliveryUserLocation record);

    /* @mbggenerated */
    @Update({
        "update delivery_user_location",
        "set user_id = #{userId,jdbcType=INTEGER},",
          "latitude = #{latitude,jdbcType=DOUBLE},",
          "longitude = #{longitude,jdbcType=DOUBLE},",
          "speed = #{speed,jdbcType=DOUBLE},",
          "accuracy = #{accuracy,jdbcType=DOUBLE},",
          "altitude = #{altitude,jdbcType=DOUBLE},",
          "verticalAccuracy = #{verticalaccuracy,jdbcType=DOUBLE},",
          "horizontalAccuracy = #{horizontalaccuracy,jdbcType=DOUBLE},",
          "create_time = #{createTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(DeliveryUserLocation record);
}